package edu.tyut.game.logic.network

import edu.tyut.game.logic.model.User
import edu.tyut.game.logic.model.WebResult
import okhttp3.MultipartBody
import retrofit2.Call
import retrofit2.http.*

interface UserService {
    @POST("user/register")
    fun register(@Body user: User): Call<WebResult<String>>

    @POST("user/login")
    fun login(@Body user: User): Call<WebResult<User>>

    @POST("user/existUser")
    fun existUser(
        @Body map: Map<String, String>
    ): Call<WebResult<Boolean>>

    @GET("user/getUser/{username}")
    fun getUser(
        @Path("username") username: String
    ): Call<WebResult<User>>

    @POST("user/updatePassword")
    fun updatePassword(
        @Body user: User
    ): Call<WebResult<Boolean>>

    @Multipart
    @POST("user/updateHeadIcon")
    fun updateHeadIcon(
        @Part files: List<MultipartBody.Part>
    ): Call<WebResult<Boolean>>
}